// +----------------------------------------------------------------------
// | 品牌api请求
// +----------------------------------------------------------------------

import request from "@/utils/request.js";


/**
 * 获取常用品牌列表
 * @param String user_id:9FE0AAB0-EF09-ED77-E05A-F02E5DA7A71C
 * @param int state = 1 来源 1：新车 2：新车寻车 3：二手车 4：二手车寻车
 *
 */
export function getCommonBrandsList(user_id, state) {
	return request.get('cars/commonBrandsList?users_id=' + user_id + '&state=' + state);
}
/**
 * 添加常用品牌
 */
export function commonBrandsAdd(data) {
	return request.post('cars/commonBrandsAdd', data);
}

/**
 * 清空常用品牌
 */
export function commonBrandsEmpty(data) {
	return request.post('cars/commonBrandsEmpty', data);
}

/**
 * 新车获取品牌列表
 *
 */
export function getNewCarBrandList() {
	return request.get('search/carsBrandList');
}

/**
 * 二手车获取品牌列表
 * @param int used_state = 0 来源 1在售车数
 *
 */
export function getBrandsList(used_state) {
	return request.get('cars/usedBrand?used_state=' + used_state);
}


/**
 * 二手车 一级车系
 */
export function getUsedVehicleSeries(brand_id,city_id,used_state) {
	return request.get('cars/usedVehicleSeries?brand_id=' + brand_id + '&city_id=' + city_id + '&used_state=' + used_state);
}
/**
 *  二手车 二级车型
 */
export function getUsedVehicleSeriesSecondary(brand_id) {
	return request.get('cars/usedVehicleSeriesSecondary?brand_id=' + brand_id);
}

/**
 * 寻车 获取品牌列表
 */
export function getUsedSearchBrandList() {
	return request.get('cars/usedSearchBrand');
}


/**
 * 寻车 一车系
 */
export function getUsedSearchSeries(brand_id) {
	return request.get('cars/usedSearchSeries?brand_id=' + brand_id);
}
/**
 *  寻车 二级车型 cars/usedSearchModels?series_id=5D6078CA-BEBB-7604-4127-0C8E815195CD
 */
export function getUsedSearchModels(series_id) {
	return request.get('cars/usedSearchModels?series_id=' + series_id);
}

/**
 *  寻车 自定义车源类型  cars/usedSearchSourceType?series_id=5D6078CA-BEBB-7604-4127-0C8E815195CD
 * @param series_id String 二级车系id
 */
export function getUsedSearchSourceType(series_id) {
	return request.get('cars/usedSearchSourceType?series_id=' + series_id);
}

export function getXsNewCarIcon() {
	return request.get('news/newsCarsIcon');
}


export function getXsSearchRecordList(users_id,state) {
	return request.get('news/searchRecordsList?users_id='+users_id+'&state='+state);
}

export function xsSearchRecordsSave(data) {
	return request.post('news/searchRecordsSave',data);
}

export function xsSearchRecordsEmpty(data) {
	return request.post('news/searchRecordsEmpty',data);
}

